package com.bst.bsj.common.dal.ibatis;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.bst.bsj.common.dal.daointerface.RoleResourceDAO;
import com.bst.bsj.common.dal.dataobject.RoleResource;
import com.sylinxsoft.tools.dao.impl.CommonBaseDAOImpl;

@Service("roleResourceDAO")
@SuppressWarnings("unchecked")
public class RoleResourceDAOImpl extends CommonBaseDAOImpl implements RoleResourceDAO {


  @Override
  public Long save(RoleResource roleResource) {
    return (Long) this.getSqlMapClientTemplate().insert(getNameSpace() + ".MS_INSERT", roleResource); 
  }


  @Override
  public int delete(Long roleId) {
    return getSqlMapClientTemplate().delete(getNameSpace() + ".MS_DELETE_BY_ROLEID", roleId);
  }


  @Override
  public List<RoleResource> getResourceByRoleId(Long roleId) {
    
    return (List<RoleResource>) this.getSqlMapClientTemplate().queryForList(getNameSpace() + ".MS_SELECT", roleId);
 }

  
}
